package com.monitor.distort.manager;

import java.util.Timer;

import com.monitor.distort.job.AddFinishWebUrlJob;
import com.monitor.distort.job.AddWgetInfoJob;
import com.monitor.distort.job.RunFinishWebUrlJob;

public class JobManager {
	
	private static Timer timer = new Timer();
	
	public JobManager(){
		
	}
	
	public static void runJobList(){
		try{
	        //设置任务计划，启动和间隔时间
	        timer.schedule(new AddWgetInfoJob(), 0, 10*1000);
    	}catch(Exception e){
    		System.out.println("AddWgetInfoJob 任务执行出错！");
    		e.printStackTrace();
    	}
		
		try{
	        //设置任务计划，启动和间隔时间
	        timer.schedule(new AddFinishWebUrlJob(), 0, 10*1000);
    	}catch(Exception e){
    		System.out.println("AddFinishWebUrlJob 任务执行出错！");
    		e.printStackTrace();
    	}
		
		try{
	        //设置任务计划，启动和间隔时间
	        timer.schedule(new RunFinishWebUrlJob(), 0, 10*1000);
    	}catch(Exception e){
    		System.out.println("RunFinishWebUrlJob 任务执行出错！");
    		e.printStackTrace();
    	}
	}

	public static void main(String[] args) {
		JobManager.runJobList();
	}

}
